package com.pig4cloud.pig.admin.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.pig4cloud.pig.admin.api.entity.SysMenu;
import com.pig4cloud.pig.admin.api.util.HttpTool;
import com.pig4cloud.pig.common.log.annotation.SysLog;
import com.pig4cloud.pig.common.security.annotation.Inner;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/indexs")
@RequiredArgsConstructor
@ConditionalOnProperty(name = "indexs.test", matchIfMissing = true)
public class TestController {

	@Inner(value = false)
	@SysLog("注册ce用户")
	@GetMapping("/test")
	public ModelAndView test() throws URISyntaxException {

		ModelAndView ms = new ModelAndView();
		System.out.print("===============");
		// ms.setViewName("/daping/wuliu/index");
		ms.setViewName("/login/login");
		return ms;
	}

	// String.format("%s::*",
	public static void main(String[] arg) {
		String PROJECT_OAUTH_ACCESS = "token::access_token";
		System.out.println(String.format("%s::*", PROJECT_OAUTH_ACCESS));

	}

}
